ga.core.validation
Interface IValidationRule<T extends IIndividual<T>>

Type Parameters:
T - The generic type of individuals.
All Known Implementing Classes:
FurnitureIntersectionRule, MaxDistanceToWallRule, MinMaxCountRule, RoomContainsRule

public interface IValidationRule<T extends IIndividual<T>>

Interface for a rule used by the RuleValidator.

Since:
11.08.2012
Author:
Stephan Dreyer

Nested Class Summary
static class IValidationRule.Type
          Type of the rule.
 
Method Summary
 IValidationRule.Type getType()
          Getter for the type of this rule.
 float matchingDegree(T individual, GAContext context)
          Calculates the matching degree in [0;1] for this rule.
 

Method Detail

matchingDegree

float matchingDegree(T individual,
                     GAContext context)
Calculates the matching degree in [0;1] for this rule. If the given individual does not match the rule, 0 will be returned.

Parameters:
individual - The individual to test.
context - The GA context.
Returns:
The matching degree between 0 and 1.
Since:
11.08.2012

getType

IValidationRule.Type getType()
Getter for the type of this rule.

Returns:
The type.
Since:
11.08.2012